═══ 1. About Cpumeter ═══ Welcome to CPUMeter, Version 1.0a I am proud to present the first public version of CPUMeter. This program is SHAREWARE, you are allowed to distribute the zipfile cpum*.zip. Do NOT redistribute any part of this zipfile. After a trial period of 4 weeks, you have to register if you want to use the program any further. Otherwise, you must remove it from your computer. CPUMeter is an enhanced CPU-usage meter, similar to "PULSE.EXE". Unlike other CPU-meters, it does not use a counting loop to determine the CPU-load. It uses the DosQProcStat API-call. This reduces CPU-load and CPU power-consumption and gives the possibility to show infos about CPU-hogging processes. This program is SHAREWARE. That means you are allowed to copy and distribute the original-archive (cpum*.zip) and you are allowed to test the program for two weeks. After that time, you MUST register it or remove the program from your PC(s). To register, send me  Money $$$$ ;-) - either DM 20,- cash or as negotiable "EUROCHECK" - or US$20,- cash or as negotiable "EUROCHECK"  Your postal-adress, so i will know where to send your registration-key. My adress is: Christof Pastors Luitpoldstr. 12 91054 Erlangen Germany I am also open to comments and discussion about my program, any constructive comment will be appreciated. If you want to contact me via email: pastors@eev.e-technik.uni-erlangen.de The newest version of CPUMeter can be found on the regular ShareWare-servers (like Hobbes) or (the very newest) at: http://eev11.e-technik.uni-erlangen.de/cpumeter.html And here the legal stuff: CPUMeter is Copyright (c) 1996, Christof Pastors This program is provided "as is" and gives you a chance to try the product for two weeks. After that time, you MUST register it or remove the program from your PC(s). I will give NO kind of SUPPORT to unregistered users (though i am open for comments and constructive crticism). I tried to find as many bugs as possible, but i am IN NO WAY RELIABLE FOR INDIRECT OR SIMILAR DAMAGES, INCLUDING ANY LOST PROFITS OR LOST DATA ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE OR ANY DATA SUPPLIED . ═══ 2. Installation ═══ Simply unzip the zipped files in a single directory. Then create a new program-object by starting cpu_inst.cmd or by dragging and customizing an object from the program-template in your templates-folder. READY. CPUMeter does not register a DLL nor does it create an entry in the ini-files of OS/2, i don't like programs modifying system-files! NEW! Accurate results with High-Resolution-Timer! To exploit all capabilities of CPUMeter, you can use the "High-Resolution-Timer". For this, you need two new drivers from IBM: CLOCK01.SYS and TIMER0.SYS. If you have one of those rare microchannel-PCs, you need the CLOCK02.SYS driver instead of clock01. With those drivers, the problem is fixed that CPUMeter shows to much CPU-load when an application is waked very often (for example to handle mouse-movement messages). BUT BE WARNED: Enabling this option can cause problems  DOS-programs that use the same hardware-timer will hang. This is propably the case with many DOS-Games.  WINDOWS-sessions may hang when starting or they can show bad response to mouse-input.  Seamless WINOS2-sessions may even block the OS/2 desktop when they hang on startup. If you have problems with a DOS-program that needs the same PC-hardware-timer, go to the settings-Notebook of CPUMeter and disable the use of HRTimer. In rare cases, you should also exit CPUMeter after this step to free the Hardware-timer. How YOU can get these drivers:  They will be part of MERLIN, the next version of OS2,  I added the MMPM_MPU.ZIP archive that comes from IBM to the CPUMeter archive. You can find the needed drivers in there.  They are part of the DEVCON 9/10 "Developer's Toolkit for OS/2 Warp" ( see BETA-section there)  They are part of the new Real-Time-Midi package developed by IBM.  And they can be found per ftp at the HOBBES-Shareware archive ( MMPM_MPU.ZIP). How to install the new drivers: If you don't use ( or need ) the according Multimedia-Setup "MINSTALL.EXE", which brings you full MPU-401 multimedia support, install them "by hand":  Make a backup copy of the old clock01.sys in the \os2\boot\ directory.  Copy the new clock01.sys and timer0.sys in this directory.  Add the statement "BASEDEV=TIMER0.SYS" to your config.sys.  Reboot. If CPUMeter can't open the new timer on program-startup, it will use the (inaccurate) standard-timer. ═══ 3. Technical Details ═══ How does it work? What's so special with this "pulse"-like app? I never liked the way most PULSE-like cpumeters work: They create an idle-priority thread that executes a infinite counting loop which hogs the CPU as soon as it is idle. This way the CPU will never get really idle.... Instead i wrote a REAL CPUMeter, that queries the OS/2 kernel every second, how much cputime all processes have consumed and then displays the result. After 10msec, the CPU is idle again. There is a "documented" undocumented API-call (DosQueryProcStat) that gives all informations one would need: Which thread of which process has consumed how much cputime and much more infos. If you are curious, take a look at pstat.exe in your \os2\ directory. Simply spoken, this program does a formatted output of the mentioned API-call. This program and the wonderful tool called "watchcat" exploit this API-call and gave me the idea ... Basically, CPUMeter queries the process-statistics every second and sums up the cputime consumed by all threads. This and the name of the most cpu-consuming process is displayed. There are some advantages and some disadvantages of this proceeding: Advantages:  It is easy to determine the process who actually hogs the CPU.  There is no Idle-Tread counting and counting. This means: - The CPU is really idle when nothing else is to do. The power consumption of the CPU is reduced dramatically. As my favorite german computer-magazine "Ct" showed, OS/2 and LINUX "HALT" the CPU when the kernel is idle between the (timer-) interrupts and nothing else is to do. On my P60, the power consumed by the CPU goes down from 12W to 4W. This could be interesting for people who like overclocking their CPUs ;-) . Or for the people who own a NOTEBOOK and wonder, why the battery goes low when PULSE is running... - Other Idle-Priority threads like the thumbnail-creator in PMVIEW.EXE or the idle-priority worker-thread in FM/2 can do their work without having to share the CPU with PULSE and its "useful" counting-loop. Disadvantages:  When threads are created and finished in a very short time (< 1sec), CPUMeter will not always see them and therefore report a lower cpu-load. Note: The next problem is fixed if you have the new High-Resolution-Timer from IBM installed! See installation for details.  When a process is waked very often (hundred times a second and faster), the kernel counts to much cputime for this thread. This can be the case for a DOS-BOX that polls the keyboard or for a window, that gets a lot of messages when you move the mouse over its window-area. Sorry, this is a restriction of the kernel, not my fault. ═══ 4. CPUMeter - Application Help ═══ CPUMeter's User-Interface consists of: Main Window, this is shown on startup. PopUpMenu, this is shown after a Right-Mousebutton-Click on the Main-Window. Process-List, you can invoke this window by selecting "Proc. List" on the PopUpMenu. Settings-Window, you can invoke this window by selecting "Settings" on the PopUpMenu. Registration-Window, you can invoke this window over the PopUpMenu, you can register CPUMeter there. For infos how to register see About CPUMeter. About-Window, you can invoke this window over the PopUpMenu, the current version-number can be found there. ═══ 4.1. CPUMeter - Main Window ═══ The Main Window The main window contains the following areas:  The Linegraph, where the CPU-load over time is displayed.  The CPU-Bargraph, where the actual CPU-load is displayed: - The total load of all processes, - the load caused by the most active process,  The Disk-Bargraph, where disk-Usage is shown: - Free space on a user-selected drive, - the swapfile-size (or another file you can choose on this drive) and - space used by other files.  The bottom-text, it gives you informations about: - The total load of all processes, - the load caused by the most active process, - and the name of this process. See the settings section on how to customize CPUMeter. ═══ 4.2. CPUMeter - Settings ═══ Settings - Notebook: You can open the settings-notebook via the PopUp menu. The "Linegraph" page allows you to change:  the line-style of the graphics (filled or not filled). Filled style looks better, but be aware that repaint consumes twice as much cputime.  the usage of a Memory-buffer for painting. This eliminates flickering of the graphics-update because all painting will be made in a memory buffer and the result will be copied to screen. This can cost three times more cputime and about 20kB memory depending on window-size.  the use of the new HighResolutionTimer. This will give perfect accuracy of the reported CPU-usage. The new clock0*.sys and timer0.sys devices are required for this option, see installation. This option can conflict with some DOS-programs (especially with some DOS-games) that use the PC hardware-timer. If you have problems, disable this checkbox and CPUMeter will release the timer.  the update interval. You can enter the number of seconds between the updates of the graph. Note: To keep track with opened and finished threads, CPUMeter makes a sample of the process-status every second, independent of the graph-update-interval. You will hardly notice this internal work. For more infos, see Technical details. The "Drives"-page allows you to change:  which drive you want to monitor ( default is your bootdrive ).  which special file on this drive you want to monoitor ( default is \os2\system\swapper.dat, Use the "Valid filename?"-button to check wether the filename and path you typed in is correct) . Other Settings. You can change other settings directly without opening the Notebook:  Window-Size: You can resize the Main window by moving the frame-border with your mouse. By default, the Main-window occupies a 150x80 pixel area at the lower-right of your desktop.  Colors: You can drag a color from the color-palette to the part of the Main-Window you want to change. Normal-dragging changes the background color of the subwindow, when you hold the "Ctrl"-key while dragging, the line- or text-color is changed.  Font: You can drag a font from a font-palette to the CPU-load textwindow. The subwindow will automatically resize to the new font-height. I recommend using non-propotional-fonts only, as they allow a fixed width of the text-columns. There will be more choices in further versions ;-) When the main window is closed, all settings are saved in cpumeter.ini. This file will be created in the actual working-path where you invoked CPUMeter. TIP: You could make different CPUMeter-objects from the program-object template. When you give them different working-directories, they store individual INI-files in each directory. This way, you could have two or more of them running side-by-side with different update intervals. ═══ 4.3. CPUMeter - About Dialog ═══ This is the help panel for the About DLG. For more informations, see "About Cpumeter". ═══ 4.3.1. CPUMeter - About Dialog , Button ═══ Press the OK-button to dismiss this window. For more informations, see "About Cpumeter". ═══ 4.4. CPUMeter - Registration Dialog ═══ Use this window to register your copy of CPUMeter. Please type your name and your registration-key EXACTLY as you got them in my response to your registration fee. ═══ 4.4.1. CPUMeter - Registration Dialog , Button ═══ Press the Register-button to enter your registration-key. ═══ 4.5. CPUMeter - Process List ═══ In this Window, the consumed CPU-time is listed per-process. Note that this IS NOT THE SAME AS THE TASKLIST! Not every process generates a switch list-entry in the tasklist. A good example for this is this is the first process named pmshell.exe in the process-list. This is Presentation-Manager itself and there is no need to generate a Tasklist-entry. On the other hand, not every window that is shown in the tasklist belongs to a different process. A good example for this is the WPShell (The second process with the exename pmshell.exe), which can create a lot of windows in the same process-space. The following informations are listed:  The Program-Icon.  Actual Load: the percentage of CPU-usage in the last second before the window was refreshed.  All Time: All time is the time consumed by the process since booting OS/2. Because the times vary heavily, the bargraph has a logarithmic scaling.  PID: The OS/2 kernel gives every process a unique ProcessID on startup.  Exename: The name of the executable file. The file-extension is always *.exe and is not shown therefore.  Title: The title of the process in the tasklist, if available. Not every running process has a corresponding entry in the tasklist (That's why the process-list may be useful in certain situations ;-) ═══ 5. CPUMeter - Keys Help ═══ This is the keys help panel. The following is a list of application-provided keys: F1 Help. F3 Exit program. Alt F4 Exit program. Control p Process List. Control s Settings.